#ifndef CLIENTCONTROLRESPONDER_H
#define CLIENTCONTROLRESPONDER_H

#include "Engine.h"
#include "InputSet.h"
#include <SDL/SDL_mixer.h>
#include <stdlib.h>

#define CTRLMSGSIZE 4

class ClientControlResponder{
public:
	ClientControlResponder( NetworkHandler *toSend, int target, bool isServer){
		keysChanged = 0;
		isUp = 0;
		isDown = 0;
		isLeft = 0;
		isRight = 0;
		handler = toSend;
		tgt = target;
		server = isServer;
	}
	void updateState(); //send control changes, if any
	void alertToInput( const InputSet& input );
protected:
	bool keysChanged;
	bool isUp;
	bool isDown;
	bool isLeft;
	bool isRight;
	//used to send state information from the server
	NetworkHandler *handler;
	int tgt;
	char buffer[CTRLMSGSIZE];
	bool server;
};

#endif

